<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户登录</title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<link href="css/User_Login.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#IbtnEnter").click(function(){
			var userName = $("#TxtUserName").val();
			var userPwd = $("#TxtPassword").val();
			if(userName=='' || userPwd == ''){
				alert("请输入用户名和密码");
				return false;
			}else{
				$.ajax({
					url:"<%=request.getContextPath() %>/admin/adminUser/login",
					data:"userName="+userName+"&userPwd="+userPwd,
					type:"POST",
					dataType: "text",
					success:function(flag){
						if(flag==0){
							top.location.href= "<%=request.getContextPath() %>/admin/index";
						}else if(flag==1){
							alert("用户名不存在,登录失败!");
						}else if(flag==2){
							alert("用户被锁定,登录失败!");
						}else if(flag==3){
							alert("用户密码错误,登录失败!");
						}else{
							alert("系统异常，登录失败！");
						}
					}
				});
			}
		});
	});
</script>
</head>
<body id="userlogin_body">
<div id="user_login">
<dl>
	<dd id="user_top">
	<ul>
		<li class="user_top_l"></li>
		<li class="user_top_c"></li>
		<li class="user_top_r"></li>
	</ul>
	<dd id="user_main">
	<ul>
		<li class="user_main_l"></li>
		<li class="user_main_c">
		<div class="user_main_box">
		<ul>
			<li class="user_main_text">用户名：</li>
			<li class="user_main_input"><input class="TxtUserNameCssClass" id="TxtUserName" maxLength="20" name="TxtUserName"></li>
		</ul>
		<ul>
			<li class="user_main_text">密 码：</li>
			<li class="user_main_input"><input class="TxtPasswordCssClass" id="TxtPassword" type="password" name="TxtPassword"></li>
		</ul>
		</div>
		</li>
		<li class="user_main_r">
			<input class="IbtnEnterCssClass" id="IbtnEnter" style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"
			type="image" src="images/user_botton.gif" name="IbtnEnter">
		</li>
	</ul>
	</dd>
	<dd id="user_bottom">
	<ul>
		<li class="user_bottom_l"></li>
		<li class="user_bottom_c"></li>
		<li class="user_bottom_r"></li>
	</ul>
	</dd>
	</dd>
</dl>
</div>
</body>
</html>
